<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="../../common.jsp"%>

<%@page import="system.base.ProductTypeManager"%>
<%@page import="framework.core.Conditions"%>
<%@page import="framework.core.DBConnection"%>
<%@page import="framework.core.ObjectList"%>
<html>
<head>
<title>交货确认</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>

<%
    String manufactureid = (String)request.getAttribute("manufactureid");
	String allCount = (String)request.getAttribute("allCount");
	String isOkCount = (String)request.getAttribute("isOkCount");
	String isNoCount = (String)request.getAttribute("isNoCount");
%>

<script language="JavaScript"><!-- 
  	      function process(){			
			if(isEmpty(document.all.currentCount.value))
			{
				alert("数量不能为空!");
				return false;
			}	
			if (isNaN(document.all.currentCount.value))
			{
				alert("本次要货确认数量请输入有效数字!");
				return false;
			}
			if(!isFloatNum(document.all.currentCount.value))
			{
				alert("请确认输入的本次要货确认数量为大于0的数字");	
				return false;
			}
			else
			{
				if(document.all.currentCount.value<=0) 
				{
					alert("本次要货确认数量必须大于0");
					return false;
				}			
				if(document.all.currentCount.value>parseFloat('<%=isNoCount%>')){
					alert("本次要货确认数量不能大于剩余未签收数量");
					return false;
				}
				if(document.all.currentCount.value==parseFloat('<%=isNoCount%>')){
					 document.all.status.value='Y';
				}else{
					 document.all.status.value='N';
				}
			}											
		
		    document.form1.action = "/gw/A150907.do";
		    document.all.manufactureid.value='<%=manufactureid%>';
		    document.all.allCount.value='<%=allCount%>';
		    document.all.isOkCount.value='<%=isOkCount%>';
      		document.form1.method="post";			
			document.form1.submit();
        }

</script>
</head>
<body BGCOLOR="#f2f2f2" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<br>
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black">要货确认</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>
<br>

<form name="form1" method="post">
<input type="hidden" name='manufactureid'>
<input type="hidden" name='allCount'>
<input type="hidden" name='isOkCount'>
<input type="hidden" name='status'>
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr> 
        <td> 
            <table class=bg_table id=tableId    cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>    
                <TR height=25>
                    <TD class="bg_column" align=center>要货总数</TD>
                    <TD align=left class="bg_row_odd" colspan="3">
                  	<%=allCount %>
                    </TD>                 
                </TR>
                  <TR height=25>
                    <TD class="bg_column" align=center>已确认数量</TD>
                    <TD align=left class="bg_row_odd" colspan="3">
                    <%=isOkCount %>
                    </TD>                 
                </TR>
                 <TR height=25>
                    <TD class="bg_column" align=center>剩余未签收数量</TD>
                    <TD align=left class="bg_row_odd" colspan="3">
                    <%=isNoCount %>
                    </TD>                 
                </TR>
                
              	  <TR height=25>
                			<td class="bg_column" align="center">本次要货确认数量</TD>
					 		  <TD align=left class="bg_row_odd" colspan="3">
							<INPUT id="currentCount" type="text" size="6"  maxlength="15" name="currentCount">
							</TD>         
                </TR>
                <TR height=25>
                    <TD class="bg_column" align=center>签收备注</TD>
                    <TD align=left class="bg_row_odd" colspan="3">
                    <textarea rows="8" cols="80" name="remark" ></textarea>
                    </TD>                 
                </TR>
            </table>
        </td>
    </tr>
</table>
<br>&nbsp;&nbsp;&nbsp; 
</form>
    <p align="center">  
        <input type="button" width="58" height="24" class="kuang" onclick="process();" value="确定"/>&nbsp;
        <input type="button"  width="58" height="24" class="kuang" onclick="history.go(-1);" value="返回"/>
    </p>
</body>
</html>